<template>
	<view class="">
		<u-navbar back-text="返回" title="车辆审核"></u-navbar>
		<u-form :model="form" ref="uForm">
			<view class="gap">基本信息</view>
			<u-form-item label="车牌号"><u-input v-model="form.carLicense" /></u-form-item>
			<u-form-item label="品牌"><u-input v-model="form.brand" /></u-form-item>
			<u-form-item label="颜色"><u-input v-model="form.color" type="select" /></u-form-item>
			<u-form-item label="注册时间">
				<u-calendar v-model="show" :mode="mode"></u-calendar>
				<u-button @click="show = true">选择时间</u-button>
			</u-form-item>
			<view class="gap">车辆图片</view>
			<u-form-item label="注册时间">
				<u-upload ref="uUpload" :action="action" :auto-upload="true" ></u-upload>
						<u-button @click="submit">提交</u-button>
			</u-form-item>
		</u-form>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				form: {
					carLicense: '',
					brand: '',
					color: '',
					registerDate: null
				},
				action: 'http://www.example.com/upload',
								filesArr: [],
				show: false,
				mode: 'date'
			};
		},
		methods:{
			submit() {
							let files = [];
							// 通过filter，筛选出上传进度为100的文件(因为某些上传失败的文件，进度值不为100，这个是可选的操作)
							files = this.$refs.uUpload.lists.filter(val => {
								return val.progress == 100;
							})
							// 如果您不需要进行太多的处理，直接如下即可
							// files = this.$refs.uUpload.lists;
							console.log(files)
						}
		}
	};
</script>

<style>
	.gap {
		display: block;
		/* Ensure the element takes full width */
		height: 80px;
		/* Set height */
		background-color: #bbb;
		/* Set background color */
		line-height: 80px;
		/* Center text vertically */
		text-align: center;
		/* Center text horizontally */
		color: #000;
		/* Text color */
		font-size: 16px;
		/* Text size */
	}
</style>